<template>
  <div>
		<el-space style="margin: 20px 0;">
			<el-input v-model="name" placeholder="请输入学生姓名" @keydown="queding($event)"></el-input>
		</el-space>
		<StudentTable :dbClick="dbclick" :list="tableData" />
  </div>
</template>

<script setup>
import StudentTable from '@@/student/table'
import { ref } from 'vue'
import { get } from '@/axios'
import { ElMessage } from 'element-plus'
const emits = defineEmits(['dbclick'])
const name = ref('')
const tableData = ref([])
function dbclick(row) {
	emits('dbclick', row)
}
function queding(event) {
	if (event.keyCode === 13 && name.value.trim() !== '') {
		getTableData()
	}
}
function getTableData () {
	get('/umsStudent/listByName', { name: name.value }, content => {
		tableData.value = content
	})
}
</script>

<style scoped lang="scss">
</style>